package com.zd.service.goodstate.impl;

import com.zd.domain.GoodState;
import com.zd.mapper.GoodStateMapper;
import com.zd.service.goodstate.GoodStateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class GoodStateServiceImpl implements GoodStateService {

    @Autowired
    private GoodStateMapper goodStateMapper;


    @Override
    public int updateGoodIsBuy(int userId, int goodId) {
        return goodStateMapper.updateGoodIsBuy(userId,goodId);
    }

    @Override
    public int updateGoodIsCollect(int userId, int goodId) {
        return goodStateMapper.updateGoodIsCollect(userId,goodId);
    }

    @Override
    public GoodState findGoodState(int userId, int goodId) {
        return goodStateMapper.findGoodState(userId,goodId);
    }

    @Override
    public int saveGoodState(int userId, int goodId) {
        return goodStateMapper.saveGoodState(userId, goodId);
    }

    @Override
    public int updateTotalDuration(int goodId, String totalTime) {
        return goodStateMapper.updateTotalDuration(goodId, totalTime);
    }

    @Override
    public int updateCurrentTime(int goodId, int userId, String currentTime) {
        return goodStateMapper.updateCurrentTime(goodId, userId, currentTime);
    }

    @Override
    public GoodState findGStateByUIdGId(int goodId, int userId) {
        return goodStateMapper.findGStateByUIdGId(goodId, userId);
    }

}
